package com.example.demo.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.example.demo.custom.BaseRepository;
import com.example.demo.entity.YanBao;
import com.example.demo.entity.YanBao2;

@Repository
public interface YanBao2Repository extends BaseRepository<YanBao2, Integer> {
		
	public List<YanBao2> findByYanBaoId(Integer id);
	/**
	 * @param car
	 * @return 通过时间排序得到最新一条
	 */
	@Query(value = "SELECT  *  FROM yan_bao2 t WHERE t.yan_bao_id=? ORDER BY t.begin_date DESC LIMIT 1 ",nativeQuery=true)
	public YanBao2 findByYanBaoId2(Integer yanBaoid);
}
